local game = require "club.threecard.hbsl"

local btn_operator = game.ui.element()

function btn_operator:ctor(send_panel)
    self.res = "club.threecard.hbsl/ui/ingame.b:btn_operator";
    self.send_panel = send_panel;
end

function btn_operator:on_injected(bind)
    bind("button.click", self.btn_auto, self.auto_ivk);
    bind("button.click", self.btn_send, self.send_ivk);
    bind("button.click", self.btn_send_continue, self.send_continue_ivk);

    game.utility.button_style.highlight(self.btn_auto);
    game.utility.button_style.highlight(self.btn_send);
    game.utility.button_style.highlight(self.btn_send_continue);
end

function btn_operator:auto_ivk()
    game.toast.show("自动");
    game.audio.post("hbsl:click");
end

function btn_operator:send_ivk()
    self.send_panel:show();
    game.audio.post("hbsl:click");
end

function btn_operator:send_continue_ivk()
    game.toast.show("连续发送");
    game.audio.post("hbsl:click");
end

return btn_operator